//
//  RecommendCollectionViewCell.m
//  MMLOOK
//
//  Created by dllo on 15/9/29.
//  Copyright © 2015年 武俊娥. All rights reserved.
//

#import "RecommendCollectionViewCell.h"
#import "UIImageView+WebCache.h"
#import "WedModel.h"

#define RealWidth ([UIScreen mainScreen].bounds.size.width - 40) / 3

@interface RecommendCollectionViewCell ()

@property(nonatomic, retain)UIImageView *image;

@end

@implementation RecommendCollectionViewCell

-(void)dealloc
{
    [_image release];
    [super dealloc];
}

-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    
    if (self) {
        
        self.image = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, RealWidth, RealWidth)];
        
        [self.contentView addSubview:self.image];
        
        [_image release];
    
    }
    
    return self;
}



-(void)setModel:(WedModel *)model
{
    if (_model != model) {
        [_model release];
        _model = [model retain];
    }
    
    
    NSLog(@"===========%@", model.photo_path);
    
    [self.image sd_setImageWithURL:[NSURL URLWithString:model.photo_path] placeholderImage:[UIImage imageNamed:@"home.jpg"]];
    
}



@end
